<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改转换')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-job-edit" th:object="${kettleJob}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">作业名称：</label>
                <div class="col-sm-8">
                    <input name="jobName" th:field="*{jobName}" class="form-control" type="text" readonly required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <textarea name="jobDescription" class="form-control">[[*{jobDescription}]]</textarea>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">作业类型(file,ftp,sf)：</label>
                <div class="col-sm-8">
                    <select name="jobType" class="form-control m-b" th:with="type=${@dict.getType('repository_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{jobType}"></option>
                    </select>
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">路径：</label>
                <div class="col-sm-8">
                    <input name="jobPath" th:field="*{jobPath}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">日志级别：</label>
                <div class="col-sm-8">
                    <select name="jobLogLevel" class="form-control m-b" th:with="type=${@dict.getType('kettle_log_level')}"  th:field="*{jobLogLevel}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  ></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">
                <label class="col-sm-3 control-label">是否监控：</label>
                <div class="col-sm-8">
                    <label class="radio-box">
                        <input type="radio" checked="" value=1 id="optionsRadios1" name="isMonitorEnabled" th:checked="${kettleJob.isMonitorEnabled == 1 ? true : false}">是</label>
                    <label class="radio-box">
                        <input type="radio" value=0 id="optionsRadios2" name="isMonitorEnabled" th:checked="${kettleJob.isMonitorEnabled == 0 ? true : false}">否</label>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">角色key:</label>
                <div class="col-sm-8">
                    <select class="form-control noselect2 selectpicker  m-b "     name="roleKey"  data-none-selected-text="可以执行该转换的角色组合" multiple   >
                        <option th:each="allRoles:${allRoles}" th:value="${allRoles}" th:text="${allRoles}"   ></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />    <script th:inline="javascript">
        var prefix = ctx + "kettle/job";
        var rkArray = [[${rkArray}]];
        $('.selectpicker').selectpicker('val',rkArray);
        $("#form-job-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-job-edit').serialize());
            }
        }

        $("input[name='createdTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>